package com.example.droideep.fragment.pager;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

import droideep.library.base.mvp.BasePresenterFragment;

/**
 * @author bri
 * @date 15-5-19.
 */
public class PagerItemFragment extends BasePresenterFragment<ItemView> {

    private static final String ARG_POS = "ARG_POS";

    public static Fragment newInstance(int position) {
        Fragment f = new PagerItemFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(ARG_POS, position);
        f.setArguments(bundle);
        return f;
    }

    @Override
    protected Class<ItemView> getVuClass() {
        return ItemView.class;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        if (getArguments() != null) {
            int pos = getArguments().getInt(ARG_POS, 0);
            vu.setText(pos + "");
        }
    }
}
